//
//  HD_LD_ClusterManager.m
//  HDWuDaDaoServiceCenter
//
//  Created by mac on 2017/7/12.
//  Copyright © 2017年 HDNiuKuiming. All rights reserved.
//

#import "HD_LD_ClusterManager.h"

@implementation HD_LD_ClusterManager

- (instancetype)init
{
    self = [super init];
    if (self) {
        _algorithm = [[HD_LD_ClusterAlgorithm alloc]init];
    }
    return self;
}

- (void)addClusterItem:(HDAnnotation*)clusterAnnotion{
    @synchronized(_algorithm) {
        [_algorithm addItem:clusterAnnotion];
    }
}
/**
 * 获取聚合后的标注
 * @param zoomLevel map的级别
 */
- (NSArray*)getClusters:(CGFloat) zoomLevel
               withRect:(CGRect)rect{
    return [_algorithm getClusters:zoomLevel withRect:rect];
}


@end
